package JavaDesign.report_5.t_1;

/**
 * @author zouran
 * createDate：2023/10/24  22:47
 */
public class Application {
    public static void main(String args[]) {
        Application client = new Application();
        Bird sparrow = new Sparrow();
        // Bird lark=new Lark();
        Bird sparrowDecorator1 = new SparrowDecoratorOne(sparrow);
        //  Bird sparrowDecorator1=new SparrowDecorator(lark);
        Bird sparrowDecorator2 = new SparrowDecoratorTwo(sparrowDecorator1);
        Bird sparrowDecorator3 = new SparrowDecoratorOne(sparrowDecorator2);
        client.needBird(sparrowDecorator1);
        client.needBird(sparrowDecorator2);
        client.needBird(sparrowDecorator3);
    }

    public void needBird(Bird bird) { //sparrowDecorator
        int flyDistance = bird.fly();
        System.out.println("这只鸟能飞行" + flyDistance + "米");
    }
}
